package com.soft.javase.ch07.test.login;

/**
 * @author wangzhisen
 * @Desc TODO
 * @date 2025/4/28
 */
public class LoginService {
    private String Username = "wzs";
    private String Password = "123456";

    public void login(String username, String password) throws LoginException {
        if (username == null || username.isEmpty() || password == null || password.isEmpty()) {
            throw new LoginException("账户或密码不能为空");
        }
        if (!username.equals(Username) || !password.equals(Password)) {
            throw new LoginException("账户与密码不匹配");
        }
        System.out.println("登录成功");
    }
}
